================================================================================
==========     addrem v1.0.0: The SNES Header Library by Killa B     ===========
================================================================================

May 29, 2009

[[ Table of Contents ]]
  i.  ) Information
  ii. ) Usage
  iii.) Compiling
  iv. ) Special Thanks

[[ i.  ) Information ]]

  This is a library for adding and removing SNES Headers. It automatically
  detects headers, so you don't have to worry about removing one that doesn't
  exist, or adding one that already exists (unless you pass SWITCH_FORCE, more
  on that later).

  It was born, not out of necessity, but of the fact that I happened to have the
  code lying around. Most of it is from my program "stripsnes" (which I plan on
  rewriting to use this library, go figure). I hope it ends up being useful to
  someone--there are certainly enough header-related problems.

[[ ii. ) Usage ]]

  addrem defines two functions:
    int remHeader(char *fname, int switches) - Removes a header
    int addHeader(char *fname, int switches) - Adds a header

  For each function, 'fname' is the rom's filename, and switches can be:
    SWITCH_NONE   - No switches, normal operation
    SWITCH_FORCE  - Force operation, ignore header detection
    SWITCH_BACKUP - Create a backup of the rom before operation
  You can combine multiple switches with the Bitwise Or operator. For example,
    SWITCH_FORCE | SWITCH BACKUP
  will force operation, and make a backup.
  
  Both functions return 0 on success. If an error occurs, they will return one
  of the following values:
    ERROR_OPENREAD - The rom couldn't be opened for reading.
    ERROR_TOOSMALL - The rom is less than 31kB. This is a special case of the
                     header detection code. No SNES rom is less than 31kB.
    ERROR_NOHEADER - No header was detected. (remHeader only)
    ERROR_HEADER   - A header was detected. (addHeader only)
    ERROR_NOBACKUP - The backup couldn't be saved (SWITCH_BACKUP only)

[[ iii.) Compiling ]]

  To use addrem, you'll have to include it in your sources.
    #include "addrem.h"

  When compiling, treat addrem.c as any one of your sources, and remember to
  link it into your program. Pretty standard stuff; I don't understand why some
  people, like the SDL bastards, make it so confusing to compile their code.

[[ iv.)  Special Thanks ]]

  I really appreciate the help I received from the following people:
    RedComet - Solved my header detection problem
    byuu     - Also solved my header detection problem, in the currently
               implemented form

  Also, although it's a cliche, thanks to Nintendo for making the Super NES,
  my favorite console of all time.
